import express from "express";
import MySQLPool from '../mysqlCreatePool';
const router = express.Router();
const db = new MySQLPool();
// 获取奖品
router.get("/", async (_req: any, res: any) => {
    const sql = `SELECT * FROM bonus`;
    try {
        const [sqlres] = await db.queryRows(sql);
        res.send({
            code: 200,
            message: '',
            data: sqlres,
        });
    } catch (e) {
        res.send({
            code: 201,
            message: e,
            data: null,
        });
    }
});
export default router